﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class CMSV2_NewsManager : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (String.IsNullOrEmpty(Request["NewsId"]))
            {
                for (int i = 1; i < this.uiMnuNews.Items.Count; i++)
                {
                    this.uiMnuNews.Items[i].Enabled = false;
                }
            }
        }

    }

    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        if (!IsPostBack)
        {
            if (!String.IsNullOrEmpty(Request["NewsId"]))
            {
                this.uiNINewsInfo.Refresh();
                this.uiNrRelations.Refresh();
            }
        }

    }

    protected void uiMnuNews_MenuItemClick(object sender, MenuEventArgs e)
    {
        int index = 0;
        if (Int32.TryParse(e.Item.Value, out index))
        {
            uiMvNews.ActiveViewIndex = index;
        }
    }
}
